package XML.g1;

import java.io.File;
import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class XMLParsingSAX {

	/**
	 * @param args
	 * @throws SAXException 
	 * @throws ParserConfigurationException 
	 * @throws IOException 
	 */
	public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException {
		SAXParserFactory factory = SAXParserFactory.newInstance();
		SAXParser parser = factory.newSAXParser();
		
		DefaultHandler handler = new PartyHandler();
		
		parser.parse(new File("partyGen.xml"),handler);
		
		System.out.println("Anzahl Elemente: "+PartyHandler.elementCount);
		System.out.println("Anzahl Attribute: "+PartyHandler.attributeCount);

	}

}
